home *** CD-ROM | disk | FTP | other *** search
- Path: lantana.singnet.com.sg!usenet
- From: s8700055@singnet.com.sg (XY Xie)
- Newsgroups: comp.lang.c
- Subject: Input filename for fopen()?
- Date: Mon, 18 Mar 1996 04:21:09 GMT
- Organization: Singapore Telecom Internet Service
- Message-ID: <4iikju$nk8@lantana.singnet.com.sg>
- NNTP-Posting-Host: ts900-4120.singnet.com.sg
- X-Newsreader: Forte Free Agent 1.0.82
-
- How do I get the user to input filename for fopen() ?
-
- I tried a gets(filename) before a fopen(filename,"r"). It worked for
- files in the current dir (when the user only has to enter the
- filename) , but it does not work for files in other dirs (when the
- user has to enter something like "c:\\windows\\letter.txt").
-
- When I tried to type the filename directly into fopen(), it worked
- fine for any file any where.
- So I guess the problem lies in the ' \ ' because C treats it as an
- escape sequence. How do I get around this?
-
- Thank you.
-
-